﻿<div class="container padding-10">
    <style>
        .active > td {
            color: white;
            background-color: #2a6496!important;
        }
    </style>

    <h3 data-bind="text: count() + '次'"></h3>
    <button class="btn btn-primary margin-t-md" data-bind="click: handleClick">点击</button>
    <hr/>

    <table class="table table-striped">
        <thead>
        <tr>
            <th>SKU</th>
            <th>名称</th>
            <th>单价</th>
        </tr>
        </thead>
        <tbody data-bind="foreach: fruits">
        <tr class="cursor-pointer" data-bind="css:{'active': selected()}, click: $root.handleItemClick">
            <td data-bind="text: sku"></td>
            <td data-bind="text: name"></td>
            <td data-bind="text: price"></td>
        </tr>
        </tbody>
    </table>
</div>

